<template>
  <div class="infoUserTop">
    <svg class="icon" aria-hidden="true" @click="$router.push('/')">
      <use xlink:href="#icon-zuojiantou"></use>
    </svg>
    <div class="top">
      <img :src="userInfo.avatarUrl" alt="" class="profileimg" />
    </div>
    <div class="name">{{ userInfo.nickname }}</div>
  </div>
</template>
<script setup>
import { ref } from 'vue'
const userInfo = ref('')
userInfo.value = JSON.parse(localStorage.getItem('userInfo'))
console.log(userInfo)
</script>
<style lang='scss' scoped>
.infoUserTop {
  position: relative;
  width: 100%;
  height: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  .icon {
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
  }
  .profileimg {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
  }
  .name {
    font-weight: 700;
    font-size: 0.4rem;
  }
}
</style>
